#ifndef _DATADCENTR_H_
#define _DATADCENTR_H_

#include <stdbool.h>

bool DataCenterInit();
bool IsUserExist(const char* name);
bool AddNewUser(const char *name,const char *passwd);
bool IsAccountEqual(const char *name,const char*passwd);
// void insertName(const char FromName);
bool CreateFriendshipTable();
bool AddFriend(const char* self_name,const char*friend_name,const char*is_friend);
int WeatherHavePerson(const char *friend_name);
bool AlreadyFriends(const char* self_name,const char* friend_name);
char** FriendRequest(const char*friend_name);
int GetTheTotalNumberOfFriendRequests(const char*friend_name);
bool ProcessFriendRequest(const char *self_name, const char *friend_name, const char* decision);
char**GetFriendList1(const char*self_name);
char**GetFriendList2(const char*friend_name);
int AlreadyFriendsCounts1(const char *self_name);
int AlreadyFriendsCounts2(const char *self_name);
bool IsAlreadyFriends(const char *self_name, const char *friend_name);
bool DeleteFriend(const char*self_name,const char*friend_name);
bool CreateGroupRelationshipTable();
bool CreateGroupChat(const char* group_name,const char*group_id,const char*creator_name);
int WeatherHasGroup(const char* group_id);
char** QueryGroupName(const char* group_name);
char** QueryGroupId(const char* group_id);
char** QueryCreatorName(const char* creator_name);
int GroupChatNumber(const char *self_name);
char* itoa(int value, char* str, int base);
int WeatherGroupAdded(const char* group_member,const char* group_name,const char* group_id,const char* creator_name);
bool ApplyGroupChat(const char* group_member,const char* group_name,const char*group_id,const char*creator_name);
int WeatherHaveGroup(const char* group_name,const char* group_id,const char* creator_name);
int WeatherGroupExit(const char* group_member,const char* group_name,const char* group_id,const char* creator_name);
bool ExitGroupChat(const char* group_member,const char* group_name,const char* group_id,const char* creator_name);
bool DeleteGroupChat(const char* group_name,const char* group_id,const char* creator_name);
char** QueryGroupName1(const char* group_name);
char** QueryGroupId1(const char* group_id);
char** QueryGroupMember(const char* group_member);
int ApplyGroupChatNumber(const char *self_name);
bool ProcessGroupChatRequest(const char *group_name, const char *group_id,const char*creator_name,const char*group_member, const char* decision);
int InviteGroupChatNumber(const char *group_name,const char *group_id,const char *creator_name,const char*group_member);
bool InviteGroupChat(const char *group_name, const char *group_id,const char*creator_name,const char*group_member);
bool CreateFriendMessagesTable();
int WeatherFriendship(const char *self_name,const char *friend_name);
char** FriendSendname(const char* receivr_name);
char** FriendMessage(const char* receivr_name);
char** FriendTimestamp(const char* receivr_name);
int FriendMessageNumber(const char* receivr_name);
bool UpdateStatusMessages(const char* receivr_name);
bool AddFriendMessage(const char *send_name, const char *receivr_name,const char*message);
bool CreateGroupMessagesTable();
#endif